Make testellipsize work for rotating non-ellipsized labels
authorMatthias Clasen <mclasen@redhat.com>
Mon, 26 Apr 2010 00:58:36 +0000 (20:58 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 26 Apr 2010 00:58:36 +0000 (20:58 -0400)
gtk/gtklabel.c

index 45522402dd27fd6780d69ba5446c9bb295d2a5f3..4590b2682c2a8cc4fb101aa626b8859964834822 100644 (file)
@@ -3450,17 +3450,17 @@ gtk_label_get_desired_size (GtkExtendedLayout *layout,
     {
       /* Note, we cant use get_size_for_allocation() when rotating ellipsize labels.
        */
-      if (angle == 90 || angle == 270 || (label->ellipsize && label->have_transform))
+      if (!(label->ellipsize && label->have_transform) && (angle == 0 || angle == 180))
        {
-         /* A vertically rotated label does w4h, so return the base desired height (text length) */
-         *minimum_size = required_rect.height;
-         *natural_size = natural_rect.height;
+         /* Doing a w4h request on a label here, return the required height for the minimum width. */
+         get_size_for_allocation (label, GTK_ORIENTATION_HORIZONTAL,
+                                  required_rect.width, minimum_size, natural_size);
        }
       else
        {
-         /* Doing a w4h request on a label here, return the required height for the minimum width. */
-         get_size_for_allocation (label, GTK_ORIENTATION_HORIZONTAL, 
-                                  required_rect.width, minimum_size, natural_size);
+         /* A vertically rotated label does w4h, so return the base desired height (text length) */
+         *minimum_size = required_rect.height;
+         *natural_size = natural_rect.height;
        }
       *minimum_size += label->misc.ypad * 2;
       *natural_size += label->misc.ypad * 2;